package com.cq.digitalemployee.user.service.impl;

import com.cq.digitalemployee.user.dao.SysUserDao;
import com.cq.digitalemployee.user.entity.po.SysUser;
import com.cq.digitalemployee.user.entity.vo.SysUserVo;
import com.cq.digitalemployee.user.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author zzz
 */
@Service
public class SysUserServiceImpl implements SysUserService {

    @Autowired
    SysUserDao sysUserDao;

    @Override
    public int add(SysUser sysUser) {
        return sysUserDao.insertSelective(sysUser);
    }

    @Override
    public int update(SysUser sysUser) {
        return sysUserDao.updateByPrimaryKeySelective(sysUser);
    }

    @Override
    public int delete(String id) {
        return sysUserDao.deleteByPrimaryKey(id);
    }

    @Override
    public SysUserVo findById(String id) {
        return sysUserDao.selectByPrimaryKey(id);
    }

    @Override
    public List<SysUserVo> findAll() {
        return sysUserDao.selectAll();
    }

    @Override
    public List<SysUserVo> findByCondition() {
        return null;
    }

    @Override
    public SysUser findByLoginName(String loginName) {
        return sysUserDao.selectByLoginName(loginName);
    }
}
